﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GcmpPickInterface.h"
#include "IEvent.h"


namespace gcmp
{
    class IPickContext;
    class IPickEventHandler;
    class IPickEventArgs;
    /// \brief 拾取事件
    ///
    /// 执行拾取得到结果后，会发送拾取事件
    class GCMP_PICK_INTERFACE_EXPORT IPickEvent : public IEvent
    {
    public:
        /// \brief 创建Pick事件对象
        /// \param name 事件对象名称
        /// \param pContext Pick事件上下文信息
        /// \return 返回创建Pick事件对象
        static OwnerPtr<IPickEvent> Create(const std::wstring& name, IPickContext* pContext = nullptr);

        /// \brief 添加拾取事件处理者
        /// \param pHandler 拾取事件处理者
        /// \return 返回true表示添加成功，否则返回false
        virtual bool Add(IPickEventHandler* pHandler) = 0;

        /// \brief 删除拾取事件处理者
        /// \param pHandler 拾取事件处理者
        /// \return 返回true表示删除成功，否则返回false
        virtual bool Delete(IPickEventHandler* pHandler) = 0;

        /// \brief 得到事件发送者
        /// \return 事件发送者
        virtual IPickContext* GetSender() const = 0;
    };
}

